// 通用响应类型
export interface ApiResponse<T = any> {
  code: number
  message: string
  data: T
}

// AI智能体类型
export interface AiAgent {
  id: number
  agentKey: string
  name: string
  description: string
  avatarUrl: string
  systemPrompt: string
  defaultVoiceType: string
  status: number
  sortOrder: number
  createTime: string
  updateTime: string
}

// 聊天会话类型
export interface ChatSession {
  id: number
  sessionId: string
  userId: string
  agentId: number
  title: string
  lastMessageTime: string
  messageCount: number
  status: number
  createTime: string
  updateTime: string
}

// 聊天消息类型
export interface ChatMessage {
  id: number
  messageId: string
  sessionId: string
  messageType: 'user' | 'assistant'
  content: string
  audioUrl?: string
  voiceType?: string
  audioDuration?: number
  status: number
  createTime: string
  updateTime: string
}

// WebSocket消息类型
export interface WebSocketMessage {
  type: string
  [key: string]: any
}

// 语音录制状态
export enum VoiceRecordingState {
  IDLE = 'idle',
  RECORDING = 'recording',
  PROCESSING = 'processing',
  PLAYING = 'playing'
}

// 用户类型
export interface User {
  id: number
  username: string
  nickname: string
  email: string
  avatarUrl?: string
  status: number
}

// 登录请求
export interface LoginRequest {
  username: string
  password: string
}

// 注册请求
export interface RegisterRequest {
  username: string
  password: string
  nickname: string
  email?: string
}

// 认证响应
export interface AuthResponse {
  token: string
  user: User
}

// 知识库类型
export interface KnowledgeBase {
  id: number
  userId: number
  name: string
  description?: string
  fileType: string
  originalFileName?: string
  fileUrl?: string
  content?: string
  fileSize?: number
  status: number
  createTime: string
  updateTime: string
}

// 上传文本请求
export interface UploadTextRequest {
  userId: number
  name: string
  description?: string
  content: string
}

// 音色信息类型
export interface VoiceInfo {
  voice_name: string
  voice_type: string
  url: string
  category: string
  updatetime: number
}

// 创建智能体请求
export interface CreateAgentRequest {
  agentKey: string
  name: string
  description: string
  avatarUrl?: string
  systemPrompt: string
  defaultVoiceType: string
  status: number
  sortOrder: number
}
